﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iMapa.UI.ModelView.Common;
using System.ComponentModel;
using iMapa.Helper;

namespace iMapa.UI.ModelView.Main
{
    public class MainViewModel : ViewModelBase
    {
        private static MainViewModel singleton;

        private Object currentViewObject;
        private SimulationGroupsViewModel mainViewObject;
        private string tooltipText;
        private string tooltipHeader;

        public MainViewModel()
        {
            mainViewObject= new SimulationGroupsViewModel(this);
            currentViewObject = mainViewObject;
            singleton = this;
        }

        public void RestoreMain()
        {
            CurrentViewObject = mainViewObject;
        }

        public Object CurrentViewObject
        {
            get { return currentViewObject; }
            set 
            {
                currentViewObject = value;
                onPropertyChanged("CurrentViewObject");
            }
        }

        public string TooltipText
        {
            get { return tooltipText; }
            set
            {
                tooltipText = value;
                onPropertyChanged("TooltipText");
            }
        }

        public string TooltipHeader
        {
            get { return tooltipHeader; }
            set
            {
                tooltipHeader = value;
                onPropertyChanged("TooltipHeader");
            }
        }

        public static void SetTooltip(string header,string text)
        {
            singleton.TooltipText = text;
            singleton.TooltipHeader = header;
        }
    }
}
